// get the client
const mysql = require('mysql2');

// Create the connection pool. The pool-specific settings are the defaults
const pool = mysql.createPool({
    host: '8.141.8.20',
    user: 'theword',
    database: 'webdata',
    port:'3306',
    password:'ddd.2023.word',
    waitForConnections: true,
    connectionLimit: 10,
    maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`
    idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000
    queueLimit: 0,
    enableKeepAlive: true,
    keepAliveInitialDelay: 0
});

// pool.query('SELECT * FROM `TheWord_user`', function(err, rows, fields) {
//     console.log(rows);
// });

module.exports = pool;